package eu.dominicum.ra.db4o;

import javax.resource.ResourceException;
import javax.resource.spi.ActivationSpec;
import javax.resource.spi.BootstrapContext;
import javax.resource.spi.ResourceAdapter;
import javax.resource.spi.ResourceAdapterInternalException;
import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.transaction.xa.XAResource;

import org.apache.log4j.Logger;

public class Db4oResourceAdapter implements ResourceAdapter {

	private static Logger LOG = Logger.getLogger(Db4oResourceAdapter.class);

	public void endpointActivation(MessageEndpointFactory endpointFactory,
			ActivationSpec spec) throws ResourceException {
		// For inbound traffic only
	}

	public void endpointDeactivation(MessageEndpointFactory endpointFactory,
			ActivationSpec spec) {
		// For inbound traffic only
	}

	public XAResource[] getXAResources(ActivationSpec[] specs)
			throws ResourceException {
		// Implement when transactions are required
		return null;
	}

	public void start(BootstrapContext ctx)
			throws ResourceAdapterInternalException {

		LOG.info("Starting Db4o Resource Adapter");

	}

	public void stop() {

		LOG.info("Stopping Db4o Resource Adapter");

	}

}
